MReMapUsingShape RemapTable.l[,SourceShapeNum.w[,DestBitmapNum.w]] ;Merge shape to bitmap using 2xWay Table

Performs a remapping operation using a previously calculated colour-lookup
table. If not specified, the currently used chunky Bitmap object will be
used as the destination for the remapping, and if a shape is not specified it
will use the currently used chunky Shape object. Pixels are read from the 
destination Bitmap and from the source Shape and their values are used as
an offset into the table (RemapTable.l is an address pointing to the base of
your table). Then a byte value, representing what colour the pixel should be
changed to, is taken from the appropriate position in the table and output
to the destination bitmap. You may wish to use a call to MQDummy to add the
affected area to the queue, otherwise multiple remaps to the same area will
cause a possibly wrong effect. The width and height of the remap operation
are equal to the width and height of the chunky Shape object being used, and
the coordinates in the Bitmap at which the remapped area will be rendered are
taken from the Shape's handle, which you should set with MHandle, and are also
dependent on any possible wrapping of the Bitmap's origin. It does not matter
if ShapeWrap is on or not. Normally the operation will output to coordinates
0,0 in the Bitmap, unless you have altered the Shape's handle, and be careful
with negative handles or ones which position the operation outside of the
Bitmap into unreserved memory because the runtime errorchecking does not check
that the operation fits. Using MReMapUsingShape it is possible to merge, mix,
add and negate the image, as well as performing various effects such as
lighting, smoke, fire, mist/fog, etc, and the table (which should be 256x256
bytes) allows all 256 colours of source and destination to be combined. Offsets
in the remapping table should be calculated using the colour from the
destination bitmap in the low byte, and the colour from the source shape in the
high byte, producing a number from 0..65535. The colour that you would like this
combination of colours to produce should then be written to the table at that
position in the table.



converted with guide2html by Kochtopf